﻿<Window x:Class="Brjnk.GpxExplorer.UI.GeocacheDetailWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:l="clr-namespace:Brjnk.GpxExplorer.Localization"
        WindowStartupLocation="CenterOwner"
        Title="{l:Loc titleGeocacheDetail}" Height="430" Width="550">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <TextBlock Name="headerId" FontWeight="Bold" />

        <TextBlock Name="headerName" Grid.Row="1" />

        <TabControl Grid.Row="2">
            <TabItem Header="{l:Loc GeocacheDetailShortInfo}">
                <WebBrowser Name="short" />
            </TabItem>

            <TabItem Header="{l:Loc GeocacheDetailLongInfo}">
                <WebBrowser Name="long" />
            </TabItem>

            <TabItem Header="{l:Loc GeocacheDetailLogs}">
                <ScrollViewer>
                    <ItemsControl Name="logs" AlternationCount="2">

                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.Style>
                                        <Style>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Path=(ItemsControl.AlternationIndex), RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContentPresenter}}" Value="0">
                                                    <Setter Property="Grid.Background" Value="{StaticResource AlternationBrush}" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Grid.Style>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Text="{Binding Date}" />
                                    <TextBlock Text="{Binding Type}" Grid.Column="1" />
                                    <TextBlock Text="{Binding Finder}" Grid.Column="2" />

                                    <TextBlock Grid.Row="1" Grid.ColumnSpan="3" Text="{Binding Text}" />
                                </Grid>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>
            </TabItem>
        </TabControl>
    </Grid>
</Window>